in core.php add BB code
=======================
$text = preg_replace("/\[chat\=(.*?)\](.*?)\[\/chat\]/is","<a href=\"chat.php?sid=$sid&amp;rid=$1&amp;sid=$sid\">$2</a>",$text);



-----------------
 in chat.php add this :
--------------------------
 echo "<a href=\"invite1.php?action=sendto&amp;sid=$sid&amp;rid=$rid\">Invite to chat</a><br/>";



--------
 and include this wherever you want to see a popup message :
------------------------------------------------------------
include ('invite.php');
======================= 
 and  add sql table invite
----------------------------


CREATE TABLE IF NOT EXISTS `invite` (
  `id` int(100) NOT NULL auto_increment,
  `text` text NOT NULL,
  `byuid` int(100) NOT NULL default '0',
  `touid` int(100) NOT NULL default '0',
  `unread` char(1) NOT NULL default '1',
  `timesent` int(100) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
